public class demo6{
    public static void main (String[] args){
        int arr[]={1,2,3,4,5};
        StringBuilder x = chang(arr);
        System.out.print(x);
        
    }
    public static StringBuilder chang(int [] arr){
    StringBuilder ar = new StringBuilder();
    ar.append("[");
    for(int i =0;i<arr.length;i++){
        
        if(i==arr.length-1){
        ar.append(arr[i]);
        }else{
        ar.append(arr[i]+",");
        }
    }
    ar.append("]");
    return ar;
    }
}